<?php
/**
 * Created by PhpStorm.
 * User: hoter.zhang
 * Date: 2016/9/2
 * Time: 15:44
 */

namespace app\modules\admin\models;


class WebConfig extends BaseConfig
{

    public $sys_site_name;
    public $sys_site_description;
    public $sys_site_keywords;
    public $sys_site_url;
    public $sys_site_email;
    public $sys_address;
    public $sys_lat_long;
    public $sys_online_time;
    //public $sys_allow_register;
    //public $sys_default_role;
    //public $sys_utc;
    //public $sys_date_format;
    //public $sys_date_format_custom;
    //public $sys_time_format;
    //public $sys_time_format_custom;
    // public $sys_lang;
    public $sys_icp;
    //public $sys_stat;
    public $sys_logo;
    public $sys_qr;
    public $sys_qq;
    public $sys_wx;
    public $sys_phone;
    public $sys_bank_address;
    public $sys_bank_card_no;
    public $sys_bank_username;

    public function rules () {
        return [
            [['sys_site_name','sys_site_description','sys_site_keywords','sys_site_url','sys_default_role','sys_utc','sys_date_format','sys_date_format_custom',
                'sys_time_format','sys_time_format_custom','sys_lang','sys_icp','sys_stat','sys_address','sys_online_time',
                'sys_logo', 'sys_lat_long', 'sys_qr', 'sys_qq', 'sys_wx', 'sys_phone', 'sys_bank_address', 'sys_bank_card_no', 'sys_bank_username'],'string'],
            [['sys_allow_register'],'boolean'],
            [['sys_site_email'],'email'],
        ];
    }

    public function attributeLabels() {
        return [
            'sys_site_name' => '网站名称',
            'sys_site_description' => '网站描述',
            'sys_site_keywords' => '网站关键字',
            'sys_site_url' => '网站URL',
            'sys_site_email' => '网站EMAIL',
            'sys_allow_register' => '允许注册',
            'sys_default_role' =>'默认角色',
            'sys_utc' => '时区',
            'sys_date_format' => '日期格式',
            'sys_date_format_custom' => '自定义日期格式',
            'sys_time_format'=>'时间格式',
            'sys_time_format_custom' => '自定义时间格式',
            'sys_lang' => '站点语言',
            'sys_icp'=>'备案号',
            'sys_stat' => '统计代码',
            'sys_bank_username' => '持卡人',
            'sys_bank_card_no' => '卡号',
            'sys_bank_address' => '开户行',
            'sys_phone' => '电话',
            'sys_wx' => '微信号',
            'sys_qq' => 'QQ',
            'sys_qr' => '二维码',
            'sys_logo' => 'logo',
            'sys_address' => '地址',
            'sys_online_time' => '营业时间',
            'sys_lat_long' => '经纬度'
        ];
    }

    public function initValue() {
        parent::initAllInternal();
    }

    public function save() {
        parent::saveAll();
        return true;
    }

    public static function sysLanguage () {
        return [
            '0' => '简体',
            '1' => '繁體',
            '2' => 'English',
        ];
    }
}